package HostContest;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Scanner;

/**
 * @description: TODO
 * @author yumo
 * @version: 1.0
 * @date 2025/3/12 17:04
 */
public class Contest {
    public static void main(String[] args) {
        Contest sc=new Contest();
        sc.arithmeticMethod();

    }

    int[]  scoreMethod(){
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入评委人数");
        int judge=scan.nextInt();
        System.out.println("请输入成绩");
        int[] arr=new int[judge];
        for (int i=0;i<judge;i++){
            arr[i]=scan.nextInt();
        }
        return arr;
    }

    void arithmeticMethod(){
        int[]myScore= scoreMethod().clone();
        int max=myScore[0];
        int min=myScore[0];
        int sum=0;
        for (int i=0;i<myScore.length;i++){

            if (max<myScore[i]){
                max=myScore[i];
            }if (min>myScore[i]){
                min=myScore[i];
            }
            sum+=myScore[i];
        }
        sum=(sum-max-min)/(myScore.length-2);
        System.out.println("max"+max);
        System.out.println("min"+min);
        System.out.println("最终评分"+sum);

    }


}
